package com.xx.ch07.demo.demo08;

import com.xx.ch07.demo.demo01.SysUser1;
import com.xx.ch07.demo.demo02.SysUser;
import com.xx.ch07.demo.demo06.SysUserMapperImpl;

import java.util.List;

/**
 * @author 许欣
 * 时间：2022/4/18 10:56
 * 描述：
 */
public class SysUserServiceImpl implements SysUserService{
    private SysUserMapperImpl sysUserMapper;
    @Override
    public List<SysUser1> getList(SysUser1 sysUser1) {
        try{
            return sysUserMapper.selectSysUserList(sysUser1);
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
    }

    public SysUserMapperImpl getSysUserMapper() {
        return sysUserMapper;
    }

    @Override
    public boolean add(SysUser1 sysUser1) {
        boolean result=false;
        try{
            if (sysUserMapper.add(sysUser1)){
                return true;
            }
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
        return result;
    }

    public void setSysUserMapper(SysUserMapperImpl sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }
}
